//
//  VidioView.m
//  Hero
//
//  Created by lanou3g on 16/5/4.
//  Copyright © 2016年 刘永庆. All rights reserved.
//

#import "VidioView.h"

@implementation VidioView

- (instancetype)initWithFrame:(CGRect)frame
{
    if (self = [super initWithFrame:frame]) {
        [self set_webView];
    }
    return self;
}
- (void)set_webView
{
    UIWebView *webView = [[UIWebView alloc]initWithFrame:CGRectMake(0, 0, self.bounds.size.width, self.bounds.size.height)];
    NSURL *url = [NSURL URLWithString:@"http://lol.qq.com/m/act/a20150319lolapp/video.htm"];
    NSURLRequest *request = [NSURLRequest requestWithURL:url];
    [self addSubview:webView];
    webView.delegate = self;
    webView.allowsPictureInPictureMediaPlayback = YES;
    webView.allowsInlineMediaPlayback = YES;
    webView.allowsLinkPreview = YES;
    [webView loadRequest:request];
}
- (BOOL)webView:(UIWebView *)webView shouldStartLoadWithRequest:(NSURLRequest *)request navigationType:(UIWebViewNavigationType)navigationType
{
        return YES;
}
@end
